package com.doujiang.bus.controller;

import com.doujiang.bus.domain.Rent;
import com.doujiang.bus.service.ICheckService;
import com.doujiang.bus.service.IRentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author：豆浆
 * @name :CheckController
 * @Date：2023/12/21 19:35
 */
@RestController
@RequestMapping("check")
public class CheckController {

    @Autowired
    private IRentService rentService;
    @Autowired
    private ICheckService checkService;


    /*
     * 查询入库信息
     * */
    @PostMapping("checkRentExist")
    public Rent checkRentExit(String rentid){
        //出租单号不存在，返回一个null,出租单号存在，返回一个rent对象
        return rentService.queryRentByRentId(rentid);
    }

    /*
     * 根据出租单号加裁检查单信息
     * */
    @PostMapping("initCheckFormData")
    public Map<String,Object> initCheckFormData(String rentid){
        return this.checkService.initCheckFormData(rentid);
    }


}
